package com.confinderence;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;

public class MainActivity extends Activity {

	ImageView mLoginImageView;
	ImageView mRegisterImageView;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_main);
		init();
	}

	private void init() {
		mLoginImageView = (ImageView) findViewById(R.id.loginImageView);
		mRegisterImageView = (ImageView) findViewById(R.id.registerImageView);
		mLoginImageView.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				goToLogin();
			}
		});
		mRegisterImageView.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				goToRegister();
			}
		});
	}
	protected void goToRegister() {
		Intent intent = new Intent(this, RegisterActivity.class);
		intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
		startActivity(intent);
	}

	protected void goToLogin() {
		Intent intent = new Intent(this, LoginActivity.class);
		intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
		startActivity(intent);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.logged_in_menu, menu);
		Utils.initMenu(menu, this);
		return true;
	}
}